package com.example.springaopdemo.demos.web.proxy;

/**
 * @author Q
 * @create 2025-06-17-9:02
 */

/**
 * 代理
 */
public class HouseProxy implements HouseSubject {
    private HouseSubject houseSubject;

    public HouseProxy(HouseSubject houseSubject) {
        this.houseSubject = houseSubject;
    }

    @Override
    public void rent() {
        System.out.println("我是代理，开始代理");
        houseSubject.rent();
        System.out.println("我是代理，结束代理");
    }

    @Override
    public void sale() {
        System.out.println("我是代理，开始代理");
        houseSubject.sale();
        System.out.println("我是代理，结束代理");
    }
}
